# Makefile for generating QR code

# Compiler
CC = gcc

# 安装目录 - 指向自定义安装的libqrencode库
INSTALL_DIR ?= ../install

# Compiler flags
CFLAGS = -Wall -g
# 添加自定义安装目录的头文件搜索路径
CFLAGS += -I$(INSTALL_DIR)/include

# 库搜索路径
LDFLAGS = -L$(INSTALL_DIR)/lib

# Libraries
LIBS = -lqrencode -lpng

# Source files
SRC = qr.c

# Output executable
TARGET = generate_qr

# Default target
all: $(TARGET)

# Build the target
$(TARGET): $(SRC)
	$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LDFLAGS) $(LIBS)

# Clean up build files
clean:
	rm -f $(TARGET)
